bugfix/package-name-resolver-for-android-outdated#2473
Conversation
|
@microsoft-github-policy-service agree |
|
@ConnorQi01 Please review the PR. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@GAM3RG33K This usually happens when test files are executed outside of a proper test environment, so globals like describe are unavailable
Suggestions:
Feel free to share your runTest.js or config details if you need further help debugging this. |
|
@ConnorQi01 Thanks for the detailed instructions about the tests... I have fixed it, Please review the PR again. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Hi @GAM3RG33K, thanks for this contribution! The fix looks great - prioritizing applicationId from build.gradle is definitely the correct approach for modern Android projects, and your test coverage is comprehensive. Before merging, could you please:
Once that's done, I'll merge it right away. Thanks again for your effort! |
…esolution Previously, the extension relied on `AndroidManifest.xml` to resolve the package name. Modern Android projects often define the package name via `applicationId` in `build.gradle`, and `AndroidManifest.xml` might not reflect the actual ID used for launching. This change ignores `AndroidManifest.xml` package name if `applicationId` can be resolved from `android/app/build.gradle`, ensuring compatibility with recent configuration standards. Fallback to `AndroidManifest.xml` is maintained if `build.gradle` parsing fails. Details: - Implements `readApplicationId` to parse `build.gradle`. - Updates `resolvePackageName` to prioritize the Gradle config. - Updates tests to use the test suite, wrappers, and mock file system correctly.
c9bd8e2 to
5ef47d7
Compare
|
This PR fixes the Issue #2493 |
|
@ConnorQi01 Done. Commits squashed, PR updated and Issues linked. Thanks for the clear instructions... |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@GAM3RG33K Thank you for providing the updates as requested. |
Package resolver should not depend on the package value from
AndroidManifest.xmlanymore, the latest android app configuration enforce adding the package name in app/build.gradle asapplicationId.Check latest documentation: https://developer.android.com/build/configure-app-module#set-application-id
Made following changes to deal with the issue: